package com.controller;


<<<<<<< HEAD
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.entity.ResumeSkillExperience;
import com.entity.ResumeStudyExperience;
import com.service.ResumeSkillExperienceService;
import com.service.ResumeStudyExperienceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.thymeleaf.util.StringUtils;

import java.util.List;
=======
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
>>>>>>> 784072f6c3135fcc1cd41893f32c7972e4abb8b2

/**
 * <p>
 * 简历-学习经历表 前端控制器
 * </p>
 *
 * @author Damon
 * @since 2021-04-26
 */
@RestController
@RequestMapping("/resume-study-experience")
<<<<<<< HEAD
@Api(value = "UsersController", tags = {"学习经历接口"})

public class ResumeStudyExperienceController {
    @Autowired
    private ResumeStudyExperienceService resumeStudyExperienceService;
    @RequestMapping("/listAll")
    @ApiOperation(value = "查询学习经历信息listAll", notes = "查询学习经历信息", httpMethod = "POST")
    public List<ResumeStudyExperience> listAll(){
        List<ResumeStudyExperience> list = resumeStudyExperienceService.list();
        return list;
    }

    @GetMapping("/list")
    @ApiOperation(value = "根据账户学习信息list", notes = "查询培训信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "简历表ID", required = true, dataType = "string"),
    })
    public List<ResumeStudyExperience> list(String resumeid){
        QueryWrapper<ResumeStudyExperience> sql = new QueryWrapper<ResumeStudyExperience>();
        sql.lambda()
                .like(!StringUtils.isEmpty(resumeid),ResumeStudyExperience::getResumeid,resumeid);
        List<ResumeStudyExperience> list = this.resumeStudyExperienceService.list(sql);
        return list;
    }



    //支持新增或修改  Post提交  /emp/edit
    @RequestMapping("/edit")
    @PostMapping("/edit")
    @ApiOperation(value = "更改教育信息edit", notes = "编辑教育信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
            @ApiImplicitParam(name = "modify", value = "0为增1为改", required = true, dataType = "string"),
    })
    public boolean edit(@RequestBody ResumeStudyExperience resumeStudyExperience){

        boolean res=false;
        if("0".equals(resumeStudyExperience.getModify())){
            //新增
            res = resumeStudyExperienceService.save(resumeStudyExperience);
        }else{
            //修改
            res = resumeStudyExperienceService.updateById(resumeStudyExperience);
        }
        return res;
    }


    @RequestMapping("/getById")
    @GetMapping("/getById")
    @ApiOperation(value = "查询教育信息getById", notes = "编辑教育信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
            @ApiImplicitParam(name = "modify", value = "0为增1为改", required = true, dataType = "string"),
    })
    public ResumeStudyExperience getById(int id){
        return resumeStudyExperienceService.getById(id);
    }

    @RequestMapping("/del")
    @PostMapping("/del")
    @ApiOperation(value = "删除教育信息del", notes = "删除教育信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
    })
    public boolean del(ResumeStudyExperience resumeStudyExperience){
        return resumeStudyExperienceService.removeById(resumeStudyExperience.getId());
    }
=======
public class ResumeStudyExperienceController {
>>>>>>> 784072f6c3135fcc1cd41893f32c7972e4abb8b2

}

